Skip to content

Fix/eew spoken review - #568

Open
archie0732 wants to merge 3 commits into
ExpTechTW:mainfrom
archie0732:fix/eew-spoken-review
Open

Fix/eew spoken review#568
archie0732 wants to merge 3 commits into
ExpTechTW:mainfrom
archie0732:fix/eew-spoken-review

Conversation

@archie0732

@archie0732 archie0732 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

這個 PR 做了什麼

處理 #546 的三則 review 意見。那個 PR 在意見處理完之前就先合併了,所以改成接續的修正。

review 意見 這裡怎麼改
朗讀開關不該放在「通知」,應該放無障礙 更多新增無障礙區塊,開關移過去
預設要關閉 預設改為關閉
重播裡面沒有實作 重播頁現在也會朗讀

相關

commit 內容

  1. feat(eew): speak the estimated intensity during a report replay

重播頁自己組地圖和 EewCard,沒有用 RtsMonitorPanel,而播報控制器住在那個面板裡,所以重播完全不會朗讀。

這裡有個分層問題:重播頁在 features/earthquake/,controller 在 features/map/presentation/,而 tool/check/layering.sh 兩個方向都擋 cross-feature 的 presentation 匯入。因此我把 MonitorEewAnnouncementController 移到 features/earthquake/domain/

我知道 ARCHITECTURE.md 把 controller 歸在 presentation。我移到 domain 的理由是這個檔案沒有任何 Flutter 匯入 沒有 widget、沒有 build,只有 dart:asynccore/ 和自己 feature 的 eew.dart。理由我寫在檔案開頭的註解裡。如果覺得該換位置,可以在討論。

然後有兩個設計:

  • 重播用自己的閘門,不是 NotificationService 的。 重播不產生通知,借用共用閘門會讓一段歷史地震的語音壓住剛好進來的真實警報的聲音。
  • App 進背景時停止播報,與重播本身的暫停同步。
  1. fix(eew): keep the spoken announcement off until it is asked for

預設改為關閉

順帶把監視器面板在沒有 provider 時的退路也從 true 改成 false,否則兩處的預設會不一致。

  1. feat(settings): put the spoken-intensity switch under accessibility

更多新增無障礙區塊,放在顯示Mesh 網路之間。12 個語系都補了字串。如圖所示:

圖片 圖片

最後我決定是讓他自成一個區塊而不是塞到顯示:那頁有一塊即時預覽面板專門用來看文字渲染,對語音毫無意義。雖然目前無障礙相關的設定(色覺調整、對比、文字大小、字重)都在顯示設定頁裡,如果之後要把它們拆出來,這個區塊可以當現成的區塊。

測試

手動(Android Emulator,x86_64)

tool\run.ps1 -d emulator-5554 --dart-define=DPIP_DEMO_MONITOR=true --dart-define=DPIP_DEMO_MONITOR_SEVERE=true --dart-define=DPIP_DEMO_MONITOR_SOUND=true
  • 更多 ➡️ 無障礙出現朗讀預估震度(預設關閉)
  • 保持關閉時,強震監視器完全不朗讀,警示音照舊會響
  • 打開之後,監視器會朗讀,且朗讀完才播警示音
  • 整列都可以點,不只開關本身

自動

  • tool/check/commits.sh upstream/main..HEAD:3 commits 通過
  • tool/dev/analyze.shflutter analyze 無問題
  • tool/check/l10n.shlayering.shstorage.shnotification_sounds.sh
  • 測試 1424 通過(test/tool/* 以外;那些在 Windows 上因 Git Bash 路徑轉換而失敗,與本次無關)
  • 新增:設定列必須落在無障礙標題與Mesh 網路標題之間: 一列悄悄跑回別的區塊,是這個測試檔本來就在防的那種改動

尚未驗證

  • 重播的朗讀沒有自動測試。 那頁本來就沒有測試檔,要建一個得把地圖、網路、ReplaySession 全部架起來。控制器本身的測試還在(隨著檔案移動到 test/features/earthquake/domain/)。重播路徑是手動驗的。
  • iOS 完全沒有實機或模擬器測試,開發環境為 Windows。

檢查清單

  • tool/check/commits.sh origin/main..HEAD 通過
  • 一個 commit 一件事(三則各自對應一則 review 意見,且每一則單獨都編得過)
  • flutter analyze 通過。測試通過
  • 新的使用者可見字串都走 AppLocalizations,沒有寫死(12 語系)
  • 有 UI 變更:沿用既有的 SectionHeader / _MoreGroup / _MoreTile,沒有引入新樣式

因為我的 github 有點問題,如果有緊急的地方需要修或是有其他的工作可以做,可以在 ExpTech Studio Discord 裡直接 tag 我 (應該是叫 4rch1e ),或是請 Kamiya 私訊我,感恩🙏

New(zh-Hant): 地震報告的重播也會朗讀預估震度,和即時監視器一樣
New(en-US): a report replay now speaks the estimated intensity, the same way the live monitor does
Fix(zh-Hant): 預估震度朗讀改為預設關閉,要用的人自己開啟
Fix(en-US): the spoken intensity announcement is off by default and has to be switched on
@PiscesXD

PiscesXD commented Sep 8, 2026

Copy link
Copy Markdown
Member

我覺得 UI 的部分,可以一個獨立的 path 的設計,否則設定頁面看起來有點小混亂

@archie0732

Copy link
Copy Markdown
Contributor Author

我覺得 UI 的部分,可以一個獨立的 path 的設計,否則設定頁面看起來有點小混亂

沒問題

New(zh-Hant): 「更多」新增「無障礙」區塊,預估震度朗讀有了自己的設定頁
New(en-US): the More menu has an Accessibility section, and the spoken intensity announcement has a page of its own
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants